export default {
  bind(el, binding) {
    let timer = null;
    const step = Number(el.getAttribute("step"))
      ? Number(el.getAttribute("step"))
      : 10;
    const targetDomCount = Number(binding.value); // 目标数字
    let nowCount = 0; //当前页面显示值
    timer = setInterval(() => {
      if (nowCount < targetDomCount) {
        nowCount += step;
      } else {
        nowCount = targetDomCount;
      }
      el.innerHTML = nowCount;
    }, 0);
  },
};
